package com.wzh.mysending.activity;

import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.wzh.mysending.R;
import com.wzh.mysending.base.BaseActivity;
import com.wzh.mysending.config.Constant;

public class StartActivity extends BaseActivity {
    Handler handler;
    Runnable runnable;
    Intent intent;
    Bundle bundle;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_start);
        intent = new Intent();
        bundle = new Bundle();
        intent.putExtras(bundle);
        handler = new Handler();
        runnable = new Runnable() {
            @Override
            public void run() {
                if ((Boolean) get(Constant.ISLOGIN, false)) {
                    intent.setClass(context, MainActivity.class);
                } else {
                    intent.setClass(context, LonginActivity.class);
                }
                startActivity(intent);
                finish();
            }
        };
        handler.postDelayed(runnable, 3500);
    }
}
